import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询单表列表
 * @param query
 * @returns {*}
 */

export const listExample4 = (query?: Example4VO): AxiosPromise<Example4VO[]> => {
  return request({
    url: '/demo/example4/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询单表详细
 * @param id
 */
export const getExample4 = (id: number): AxiosPromise<Example4VO> => {
  return request({
    url: '/demo/example4/' + id,
    method: 'get'
  });
};

/**
 * 新增单表
 * @param data
 */
export const addExample4 = (data: Example4VO) => {
  return request({
    url: '/demo/example4',
    method: 'post',
    data: data
  });
};

/**
 * 修改单表
 * @param data
 */
export const updateExample4 = (data: Example4VO) => {
  return request({
    url: '/demo/example4',
    method: 'put',
    data: data
  });
};

/**
 * 删除单表
 * @param id
 */
export const delExample4 = (id: number | Array<number>) => {
  return request({
    url: '/demo/example4/' + id,
    method: 'delete'
  });
};

export interface Example4VO extends BaseEntity {
  /** 主键 */
  id?: number;

  /** 名称 */
  name?: string;

  /** 状态 */
  status?: string;
  sort?: number;
  /** 备注 */
  remark?: string;
  customerName?: string;
  customerId?: number;
}
